/**
 * Created by YJH on 2018/5/30.
 */
import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    TouchableOpacity,
    Image,
} from 'react-native';
export default class FavoriteUtil {


    /**
     * 判断用户是否已经搜藏过了项目item
     * 就是 点击了搜藏按钮
     * @param item
     * @param items
     * @returns {boolean}
     */
    static checkFavorite(item, items){
        for(let i=0,l=items.length;i<l;i++){
            const id=item.id?item.id:item.fullName;
            if(id===items[i]){
                return true;
            }
        }

        return false;
    }
}

